<ul>
    <#list (page.content)! as comment >
        <li class="rev-item comment-item clearfix">
            <div class="user"><a class="avatar" href="/mine/homepage?uid=${comment.userId}"
                                 target="_blank"><img
                            src="${(comment.headUrl)!}"
                            width="48" height="48"></a><span class="level">lv${comment.level!}</span></div>
            <a class="useful" data-id="${comment.id}" title="点赞">
                <i></i><span class="useful-num">${comment.thumbupnum}</span>
            </a>
            <span>${(comment.createTime)?string("yyyy-MM-dd")}</span></br>
            <a class="name" href="/u/52068941.html" target="_blank">${comment.username}</a>
            <span class="s-star s-star${(comment.rank)!}"></span>
            <p class="rev-txt">
                ${(comment.comment)!}
            </p>

            <div class="rev-img">
                <a href="#" target="_blank">
                         <img src="${(comment.tupianUrl)!}" width="100" height="100" target="_blank" onerror="this.style.display='none'">
                </a>
            </div>

            <div class="info clearfix">
                <a class="btn-comment _j_comment" title="添加评论">评论</a>
                <span class="time">${(comment.createTime?string('yyyy-MM-dd HH:mm'))!}</span>
                <span class="from">
      此条点评来自<a href="" target="_blank">马蜂窝旅游APP</a>
          <div class="comment add-reply ">

              <ul class="more_reply_box comment_list">
                  <#-- 评论的评论 -->
                  <#list comment.comments as cc>
                      <li>
                          <a href="/mine/home?uid=${cc.userId}" target="_blank">
                              <img src="${cc.headUrl}"
                                   width="16" height="16">${cc.username}
                          </a>
                          ：${cc.comment}
                          <a class="_j_reply re_reply" data-id="625204" data-uid="<#--63107989--> ${(cc.refComment.userId)!}"
                             data-username="${(cc.refComment.username)!}" title="添加回复">回复</a>
                          <br><span class="time">${(cc.createTime)?string("yyyy-MM-dd-mm")}</span>
                      </li>
                  </#list>
              </ul>

              <div class="add-comment  reply-form" style="display: none;">
                  <textarea class="comment_reply" id="commentReply"
                            data-commentId="${comment.id}" data-scenicId="${comment.scenicId}"
                            data-type="1"
                            style="overflow: hidden; color: rgb(117,251,243);"></textarea>
                  <a class="btn btn_submit_reply">回复</a>
              </div>

          </div>
        </li>
    </#list>
    <script>
        //点击评论弹出评论框
        $("._j_comment").click(function () {
            $(this).next(".reply-form").toggle();
            $(".reply-form ").toggle();
            $("#commentReply").click();
        });
        //评论的评论
        $('.btn_submit_reply').click(function () {
            var id = $(this).prev("textarea").attr("data-commentId");
            var scenicId = $(this).prev("textarea").attr("data-scenicId");
            var type = $(this).prev("textarea").attr("data-type");
            var comment = $(this).prev("textarea").val();
            $.post("/scenic/saveComment", {id: id, scenicId: scenicId, type: type, comment: comment}, function (data) {
                if (data.success) {
                    window.location.reload();
                } else {
                    alert(data.msg);
                }
            })
        })

        $('.re_reply').click(function () {
            $(this).next(".reply-form").toggle();
            $(".reply-form ").toggle();
            $("#commentReply").click();
        })
        //点赞
        $(".useful").click(function () {
            var id = $(this).data("id");
            var b = $(this);
            $.get("/scenic/scenicThumbup", {id: id}, function (data) {
                if (data.data) {
                    b.addClass("on");
                    var a = b.find('span').html();
                    b.find('span').html(parseInt(a) + 1);
                } else {
                    if (data.code == 102) {
                        popup(data.msg);
                    } else {
                        b.removeClass("on");
                        var a = b.find('span').html();
                        b.find('span').html(parseInt(a) - 1);
                    }
                }
            })
        })
    </script>
    <#include "../common/pageSearch.ftl">
</ul>